package com.caimiao.miao.page.master.system.server;

import com.caimiao.miao.http.retorfit.HttpConfig;
import com.caimiao.miao.http.rxjava.transformer.SchedulerTransformer;

import io.reactivex.Observable;

public class ServerModel implements IServerContact.Model {


    @Override
    public String getBaseUrl() {
        return HttpConfig.getBaseUrl();
    }

    @Override
    public Observable<Boolean> save(String url) {
        return Observable.just(url)
                .map(s -> {
                    HttpConfig.setBaseUrl(url);
                    return true;
                })
                .compose(SchedulerTransformer.applyIoAndUi());
    }
}
